document.write( '<script src="' + host + '/content/editor/kindeditor-min.js" charset="utf-8"></script>' );
document.write( '<script src="' + host + '/content/editor/lang/zh_CN.js" charset="utf-8"></script>' );

var editor1, editor2;

function showEdit1( type ) {
	var options = {
		allowPreviewEmoticons:false,
		allowImageUpload:false,
		allowFlashUpload:false,
		allowFileManager:false,
		newlineTag:'br',
        cssData:".prettyprint { padding: 8px; background-color: #f7f7f9;border: 1px solid #e1e1e8; border-radius: 5px;}",
		pasteType:type,
        items:[
            'source', 'wordpaste', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
            'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'code', '|', 'image', 'flash', 'link' , 'unlink',
            'baidumap' , 'quickformat', 'clearhtml', 'about'
        ]
	};
	KindEditor.ready( function ( K ) {
		editor1 = K.create( '#message', options );
	});
	return editor1;
}

function showEdit2() {
	var options = {
		allowPreviewEmoticons:false,
		allowImageUpload:false,
		allowFlashUpload:false,
		allowFileManager:false,
		newlineTag:'br',
		pasteType:1,
		items:[
			'source', '|', 'fontname', 'fontsize', '|', 'forecolor', 'bold', '|', 'code', 'image', 'quickformat', 'about']
	};
	KindEditor.ready( function ( K ) {
		editor2 = K.create( '#excerpt', options );
	});
}

function insert( html ) {
	if ( editor1.designMode ) {
		editor1.insertHtml( html ).select( true );
	} else {
		alert( '请先将编辑器切换到可视化模式!' );
	}
}